package com.isunland.managesystem.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import com.isunland.managesystem.R;
import com.isunland.managesystem.common.ApiConst;
import com.isunland.managesystem.entity.BookOrderInfo;

/**
 * 对象功能:农机组织在线接单
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/3/17 13:50
 */
public class OnlineReceiveOrderListFragment extends BaseOrderListFragment {
  private static final int REQUEST_DETAIL = 1;

  @Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitleCustom(R.string.onlineAcceptOrder);
  }

  @Override public String getUrl() {
    return ApiConst.URL_QUERY_LIST_ENABLE_RECEIVE_ORDER;
  }

  @Override public void onListItemClick(ListView l, View v, int position, long id) {
    BookOrderInfo item = mAdapter.getItem(position - mListview.getHeaderViewsCount());
    OnlineReceiveOrderDetailActivity.newInstance(this, mActivity, item, REQUEST_DETAIL);
  }

  @Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK) return;
    volleyPost();
  }
}
